package org.darkforest.model;

import org.darkforest.common.util.DateUtil;
import org.darkforest.common.util.Page;

import java.math.BigDecimal;

public class PXianshiGoods extends Page<PXianshiGoods> {
    private Integer xianshiGoodsId;

    private Integer xianshiId;

    private String xianshiName;

    private String xianshiTitle;

    private String xianshiExplain;

    private Integer goodsId;

    private Integer storeId;

    private String storeName;

    private String goodsName;

    private BigDecimal goodsPrice;

    private BigDecimal xianshiPrice;

    private String goodsImage;

    private Integer startTime;

    private Integer endTime;

    private Integer lowerLimit;

    private Byte state;

    private Byte xianshiRecommend;

    private String xianShiGoodsslogan;

    private String xianShiGoodsImage;

    private BigDecimal goodsMarketprice;

    private Integer sellAmt;            //总销量

    private String endTimeDes;

    private Integer goodsCommonid;

    public Integer getGoodsCommonid() {
        return goodsCommonid;
    }

    public void setGoodsCommonid(Integer goodsCommonid) {
        this.goodsCommonid = goodsCommonid;
    }

    public String getStoreName() {
        return storeName;
    }

    public void setStoreName(String storeName) {
        this.storeName = storeName;
    }

    public String getEndTimeDes() {
        return endTimeDes;
    }

    public void setEndTimeDes(String endTimeDes) {
        this.endTimeDes = endTimeDes;
    }

    //秒杀商品剩余时间
    public Integer getSurplusTime() {
        return (this.endTime - DateUtil.unixTimeStampInt().intValue()) * 1000;
    }

    public BigDecimal getDiscount(){
        BigDecimal discount = xianshiPrice.multiply(new BigDecimal(10)).divide(goodsMarketprice,1,BigDecimal.ROUND_HALF_UP);
//        discount.setScale(1,BigDecimal.ROUND_HALF_UP);
        return discount;
    }
    public PXianshiGoods(){

    }

    public PXianshiGoods(Integer xianshiId){
        this.xianshiId = xianshiId;
    }

    public BigDecimal getGoodsMarketprice() {
        return goodsMarketprice;
    }

    public void setGoodsMarketprice(BigDecimal goodsMarketprice) {
        this.goodsMarketprice = goodsMarketprice;
    }

    public String getXianShiGoodsslogan() {
        return xianShiGoodsslogan;
    }

    public void setXianShiGoodsslogan(String xianShiGoodsslogan) {
        this.xianShiGoodsslogan = xianShiGoodsslogan;
    }

    public String getXianShiGoodsImage() {
        return xianShiGoodsImage;
    }

    public void setXianShiGoodsImage(String xianShiGoodsImage) {
        this.xianShiGoodsImage = xianShiGoodsImage;
    }

    public Integer getXianshiGoodsId() {
        return xianshiGoodsId;
    }

    public void setXianshiGoodsId(Integer xianshiGoodsId) {
        this.xianshiGoodsId = xianshiGoodsId;
    }

    public Integer getXianshiId() {
        return xianshiId;
    }

    public void setXianshiId(Integer xianshiId) {
        this.xianshiId = xianshiId;
    }

    public String getXianshiName() {
        return xianshiName;
    }

    public void setXianshiName(String xianshiName) {
        this.xianshiName = xianshiName == null ? null : xianshiName.trim();
    }

    public String getXianshiTitle() {
        return xianshiTitle;
    }

    public void setXianshiTitle(String xianshiTitle) {
        this.xianshiTitle = xianshiTitle == null ? null : xianshiTitle.trim();
    }

    public String getXianshiExplain() {
        return xianshiExplain;
    }

    public void setXianshiExplain(String xianshiExplain) {
        this.xianshiExplain = xianshiExplain == null ? null : xianshiExplain.trim();
    }

    public Integer getGoodsId() {
        return goodsId;
    }

    public void setGoodsId(Integer goodsId) {
        this.goodsId = goodsId;
    }

    public Integer getStoreId() {
        return storeId;
    }

    public void setStoreId(Integer storeId) {
        this.storeId = storeId;
    }

    public String getGoodsName() {
        return goodsName;
    }

    public void setGoodsName(String goodsName) {
        this.goodsName = goodsName == null ? null : goodsName.trim();
    }

    public BigDecimal getGoodsPrice() {
        return goodsPrice;
    }

    public void setGoodsPrice(BigDecimal goodsPrice) {
        this.goodsPrice = goodsPrice;
    }

    public BigDecimal getXianshiPrice() {
        return xianshiPrice;
    }

    public void setXianshiPrice(BigDecimal xianshiPrice) {
        this.xianshiPrice = xianshiPrice;
    }

    public String getGoodsImage() {
        return goodsImage;
    }

    public void setGoodsImage(String goodsImage) {
        this.goodsImage = goodsImage == null ? null : goodsImage.trim();
    }

    public Integer getStartTime() {
        return startTime;
    }

    public void setStartTime(Integer startTime) {
        this.startTime = startTime;
    }

    public Integer getEndTime() {
        return endTime;
    }

    public void setEndTime(Integer endTime) {
        this.endTime = endTime;
    }

    public Integer getLowerLimit() {
        return lowerLimit;
    }

    public void setLowerLimit(Integer lowerLimit) {
        this.lowerLimit = lowerLimit;
    }

    public Byte getState() {
        return state;
    }

    public void setState(Byte state) {
        this.state = state;
    }

    public Byte getXianshiRecommend() {
        return xianshiRecommend;
    }

    public void setXianshiRecommend(Byte xianshiRecommend) {
        this.xianshiRecommend = xianshiRecommend;
    }

    public void setSellAmt(Integer sellAmt){
        this.sellAmt = sellAmt;
    }
    public Integer getSellAmt(){
        return this.sellAmt;
    }



}